<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">



  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Java,">





  <link rel="alternate" href="/atom.xml" title="DG" type="application/atom+xml">






<meta name="description" content="Day6day01-java入门jdk组成1jdk包含jre,jre包含jvm; 标识符1就是起的名字;类名要大驼峰(所有单词首字母大写)格式,变量名和方法名要符合小驼峰(只有第一个单词首字母小写,剩下的单词首字母大写)格式; 关键字1java中有特殊含义的单词就是关键字; 常量1整数常量,小数常量,字符常量(需要使用单引号),字符串常量(需要使用双引号),boolean常量(true,false">
<meta name="keywords" content="Java">
<meta property="og:type" content="article">
<meta property="og:title" content="Day6-前5天总结">
<meta property="og:url" content="http://zhaowenhao99.github.io/2019/09/06/Day6-前5天总结/index.html">
<meta property="og:site_name" content="DG">
<meta property="og:description" content="Day6day01-java入门jdk组成1jdk包含jre,jre包含jvm; 标识符1就是起的名字;类名要大驼峰(所有单词首字母大写)格式,变量名和方法名要符合小驼峰(只有第一个单词首字母小写,剩下的单词首字母大写)格式; 关键字1java中有特殊含义的单词就是关键字; 常量1整数常量,小数常量,字符常量(需要使用单引号),字符串常量(需要使用双引号),boolean常量(true,false">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-09-28T00:12:45.166Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Day6-前5天总结">
<meta name="twitter:description" content="Day6day01-java入门jdk组成1jdk包含jre,jre包含jvm; 标识符1就是起的名字;类名要大驼峰(所有单词首字母大写)格式,变量名和方法名要符合小驼峰(只有第一个单词首字母小写,剩下的单词首字母大写)格式; 关键字1java中有特殊含义的单词就是关键字; 常量1整数常量,小数常量,字符常量(需要使用单引号),字符串常量(需要使用双引号),boolean常量(true,false">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://zhaowenhao99.github.io/2019/09/06/Day6-前5天总结/">





  <title>Day6-前5天总结 | DG</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
    <a href="https://zhaowenhao99.github.io/" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewbox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"/><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"/><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"/></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">DG</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://zhaowenhao99.github.io/2019/09/06/Day6-前5天总结/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="大狗">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/icon.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="DG">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Day6-前5天总结</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-09-06T08:09:33+08:00">
                2019-09-06
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/学习/" itemprop="url" rel="index">
                    <span itemprop="name">学习</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
               <span title="字数统计">
                    1.7k 字 
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                    6 分钟
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="Day6"><a href="#Day6" class="headerlink" title="Day6"></a>Day6</h1><h1 id="day01-java入门"><a href="#day01-java入门" class="headerlink" title="day01-java入门"></a>day01-java入门</h1><h2 id="jdk组成"><a href="#jdk组成" class="headerlink" title="jdk组成"></a>jdk组成</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">jdk包含jre,jre包含jvm;</span><br></pre></td></tr></table></figure>
<h2 id="标识符"><a href="#标识符" class="headerlink" title="标识符"></a>标识符</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">就是起的名字;类名要大驼峰(所有单词首字母大写)格式,变量名和方法名要符合小驼峰(只有第一个单词首字母小写,剩下的单词首字母大写)格式;</span><br></pre></td></tr></table></figure>
<h2 id="关键字"><a href="#关键字" class="headerlink" title="关键字"></a>关键字</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java中有特殊含义的单词就是关键字;</span><br></pre></td></tr></table></figure>
<h2 id="常量"><a href="#常量" class="headerlink" title="常量"></a>常量</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">整数常量,小数常量,字符常量(需要使用单引号),字符串常量(需要使用双引号),<span class="keyword">boolean</span>常量(<span class="keyword">true</span>,<span class="keyword">false</span>),<span class="keyword">null</span></span><br></pre></td></tr></table></figure>
<h2 id="数据类型"><a href="#数据类型" class="headerlink" title="数据类型"></a>数据类型</h2><h3 id="基本数据类型"><a href="#基本数据类型" class="headerlink" title="基本数据类型"></a>基本数据类型</h3><table>
<thead>
<tr>
<th>类型名称</th>
<th>单词</th>
</tr>
</thead>
<tbody>
<tr>
<td>最小的整数</td>
<td>byte</td>
</tr>
<tr>
<td>小的整数</td>
<td>short</td>
</tr>
<tr>
<td>默认的整数</td>
<td>int</td>
</tr>
<tr>
<td>大整数</td>
<td>long   数据值加L</td>
</tr>
<tr>
<td>单精度小数</td>
<td>float  数据值需要加F</td>
</tr>
<tr>
<td>双精度小数</td>
<td>double</td>
</tr>
<tr>
<td>字符</td>
<td>char</td>
</tr>
<tr>
<td>布尔</td>
<td>boolean</td>
</tr>
</tbody>
</table>
<p>特殊的引用数据类型:  String  字符串类型</p>
<h3 id="引用数据类型"><a href="#引用数据类型" class="headerlink" title="引用数据类型"></a>引用数据类型</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">接口,类,数组</span><br></pre></td></tr></table></figure>
<h2 id="变量"><a href="#变量" class="headerlink" title="变量"></a>变量</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">程序中可以变化的数据就是变量;(变量是内存中的小盒子,可以保存数据和获取数据)</span><br></pre></td></tr></table></figure>
<h3 id="定义格式"><a href="#定义格式" class="headerlink" title="定义格式"></a>定义格式</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">数据类型  变量名 = 数据值;</span><br><span class="line">存值格式:变量名=数据值;</span><br><span class="line">取值格式:变量名;</span><br></pre></td></tr></table></figure>
<h2 id="类型转换"><a href="#类型转换" class="headerlink" title="类型转换"></a>类型转换</h2><p>从一种类型变成另一种类型,类型转换;</p>
<p>分为自动类型转换(无风险),强制类型转换(容易发生数据精度丢失);</p>
<p>大小顺序:</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">byte</span> &lt; <span class="keyword">short</span> &lt; <span class="keyword">int</span> &lt; <span class="keyword">long</span> &lt; <span class="keyword">float</span>&lt; <span class="keyword">double</span></span><br><span class="line">       <span class="keyword">char</span></span><br><span class="line"><span class="keyword">boolean</span> 不参与类型转换;</span><br></pre></td></tr></table></figure>
<h1 id="day02-运算符-键盘输入-if语句"><a href="#day02-运算符-键盘输入-if语句" class="headerlink" title="day02-运算符,键盘输入,if语句"></a>day02-运算符,键盘输入,if语句</h1><h2 id="运算符"><a href="#运算符" class="headerlink" title="运算符"></a>运算符</h2><h3 id="算术运算符"><a href="#算术运算符" class="headerlink" title="算术运算符"></a>算术运算符</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">/   整数除以整数结果还是整数;</span><br><span class="line">%   求的是余数;</span><br><span class="line">+    如果左右两边都是可以运算的数字或字符,那么会当成数字的加法运算;如果左右两边有至少一个是字符串,则当成连接运算;</span><br></pre></td></tr></table></figure>
<h3 id="关系运算符"><a href="#关系运算符" class="headerlink" title="关系运算符"></a>关系运算符</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&lt;</span><br><span class="line">   &gt;</span><br><span class="line">   &gt;=</span><br><span class="line">   &lt;=</span><br><span class="line">   ==</span><br><span class="line">   !=</span><br></pre></td></tr></table></figure>
<h3 id="赋值运算符"><a href="#赋值运算符" class="headerlink" title="赋值运算符"></a>赋值运算符</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">	=</span><br><span class="line">  	+=   先使用左边的变量与右边的数据相加,然后把运算的结果重新赋值给左边的变量;(隐含了强制类型转换)</span><br><span class="line"><span class="keyword">byte</span> a=<span class="number">10</span>;</span><br><span class="line">a+=<span class="number">10</span>;(隐含了强制类型转换)</span><br><span class="line">最终a依然是<span class="keyword">byte</span>类型;</span><br></pre></td></tr></table></figure>
<h3 id="逻辑运算符"><a href="#逻辑运算符" class="headerlink" title="逻辑运算符"></a>逻辑运算符</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&amp;&amp;   有<span class="keyword">false</span>则<span class="keyword">false</span></span><br><span class="line">   ||    有<span class="keyword">true</span>则<span class="keyword">true</span></span><br><span class="line">   !     非真既假</span><br></pre></td></tr></table></figure>
<h3 id="三元运算符"><a href="#三元运算符" class="headerlink" title="三元运算符"></a>三元运算符</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">boolean</span>类型结果的表达式?结果<span class="number">1</span>:结果<span class="number">2</span>;</span><br></pre></td></tr></table></figure>
<h2 id="键盘输入"><a href="#键盘输入" class="headerlink" title="键盘输入"></a>键盘输入</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">idea使用步骤:</span><br><span class="line"><span class="number">1</span>:直接创建对象;(自动导包)</span><br><span class="line"><span class="number">2</span>:调用方法;</span><br><span class="line">	nextInt();  输入整数;</span><br><span class="line">	nextDouble(); 输入小数;</span><br><span class="line">	next();  输入不带空格的字符串;</span><br></pre></td></tr></table></figure>
<h2 id="if语句"><a href="#if语句" class="headerlink" title="if语句"></a>if语句</h2><p>仅对一种情况进行判断,如果成功则做事情,否则就不做事情;</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(<span class="keyword">boolean</span>类型的结果)&#123;</span><br><span class="line">    被控制的语句体;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>如果成功则做事情1,否则就做事情2;</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(<span class="keyword">boolean</span>类型的结果)&#123;</span><br><span class="line">    被控制的语句体<span class="number">1</span>;</span><br><span class="line">&#125;<span class="keyword">else</span>&#123;</span><br><span class="line">    被控制的语句体<span class="number">2</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>如果多种情况选择其一,可以使用下面的格式</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(<span class="keyword">boolean</span>类型的结果<span class="number">1</span>)&#123;</span><br><span class="line">    被控制的语句体<span class="number">1</span>;</span><br><span class="line">&#125;<span class="keyword">else</span> <span class="keyword">if</span>(<span class="keyword">boolean</span>类型的结果<span class="number">2</span>) &#123;</span><br><span class="line">    被控制的语句体<span class="number">2</span>;</span><br><span class="line">&#125;....&#123;</span><br><span class="line">    </span><br><span class="line">&#125;<span class="keyword">else</span>&#123;</span><br><span class="line">    被控制的语句体n;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h1 id="day03-switch语句-循环语句-随机数"><a href="#day03-switch语句-循环语句-随机数" class="headerlink" title="day03-switch语句,循环语句,随机数"></a>day03-switch语句,循环语句,随机数</h1><h2 id="switch语句"><a href="#switch语句" class="headerlink" title="switch语句"></a>switch语句</h2><p>如果多种情况选择其一,且与数据值相关的时候,可以使用switch语句优化代码格式;</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">switch</span>(数据值)&#123;</span><br><span class="line">    <span class="keyword">case</span> 数据值<span class="number">1</span>:</span><br><span class="line">        语句体<span class="number">1</span>;</span><br><span class="line">        <span class="keyword">break</span>;</span><br><span class="line">    <span class="keyword">case</span> 数据值<span class="number">2</span>:</span><br><span class="line">        语句体<span class="number">2</span>;</span><br><span class="line">        <span class="keyword">break</span>;</span><br><span class="line">     ...</span><br><span class="line">     <span class="keyword">default</span>:</span><br><span class="line">      语句体n; </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="注意事项"><a href="#注意事项" class="headerlink" title="注意事项"></a>注意事项</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1</span>:支持的数据类型有:  <span class="keyword">byte</span>,<span class="keyword">short</span>,<span class="keyword">int</span>,<span class="keyword">char</span>,String,枚举;</span><br><span class="line"><span class="number">2</span>:如果不写<span class="keyword">break</span>,会发生穿透现象;</span><br></pre></td></tr></table></figure>
<h2 id="循环语句"><a href="#循环语句" class="headerlink" title="循环语句"></a>循环语句</h2><h3 id="for循环"><a href="#for循环" class="headerlink" title="for循环"></a>for循环</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span>(初始化表达式;判断语句;控制语句)&#123;</span><br><span class="line">    循环体;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="while循环"><a href="#while循环" class="headerlink" title="while循环"></a>while循环</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">初始化表达式;</span><br><span class="line"><span class="keyword">while</span>(判断语句)&#123;</span><br><span class="line">     循环体;</span><br><span class="line">    控制语句;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="for和while的区别"><a href="#for和while的区别" class="headerlink" title="for和while的区别"></a>for和while的区别</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1</span>:<span class="keyword">for</span>结束之后,变量不可以继续使用了;而<span class="keyword">while</span>可以继续使用;</span><br><span class="line"><span class="number">2</span>:<span class="keyword">for</span>一般用于有明确的循环次数,而<span class="keyword">while</span>一般用于循环次数不确定;</span><br></pre></td></tr></table></figure>
<h3 id="跳转语句"><a href="#跳转语句" class="headerlink" title="跳转语句"></a>跳转语句</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">break</span>   结束循环;</span><br><span class="line"><span class="keyword">continue</span>  忽略当前这一次循环,并开始下一次循环;</span><br></pre></td></tr></table></figure>
<h3 id="循环嵌套"><a href="#循环嵌套" class="headerlink" title="循环嵌套"></a>循环嵌套</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">建议使用debug观察循环嵌套执行的流程!!!</span><br><span class="line">写<span class="number">99</span>乘法表;</span><br></pre></td></tr></table></figure>
<h2 id="随机数"><a href="#随机数" class="headerlink" title="随机数"></a>随机数</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">idea的使用步骤:</span><br><span class="line"><span class="number">1</span>: 直接创建对象;  Random  r=<span class="keyword">new</span> Random();</span><br><span class="line"><span class="number">2</span>: 调用方法;      <span class="keyword">int</span> 变量名= r.nextInt(范围);</span><br><span class="line"></span><br><span class="line">任意范围的随机数:</span><br><span class="line"> <span class="keyword">int</span> 变量名= r.nextInt(最大值-最小值+<span class="number">1</span>)+最小值;</span><br></pre></td></tr></table></figure>
<h1 id="day04-idea与数组"><a href="#day04-idea与数组" class="headerlink" title="day04-idea与数组"></a>day04-idea与数组</h1><h2 id="idea快捷键"><a href="#idea快捷键" class="headerlink" title="idea快捷键"></a>idea快捷键</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">ctrl +x   剪切</span><br><span class="line">ctrl + D  复制一行</span><br><span class="line">ctrl + Y  删除一行</span><br><span class="line">alt  +  enter  智能解决语法错误</span><br><span class="line">alt+shift+上/下    上/下移动代码</span><br><span class="line">数组名.fori    遍历数组</span><br><span class="line">方法名(实际参数).<span class="keyword">var</span>  +  enter   自动生成变量;</span><br></pre></td></tr></table></figure>
<h2 id="数组"><a href="#数组" class="headerlink" title="数组"></a>数组</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">动态初始化:  只指定长度,不指定内容,java会默认给内容;</span><br><span class="line">    数据类型[]  数组名 = <span class="keyword">new</span> 数据类型[长度];</span><br><span class="line">    存值:  数组名[索引] = 数据值;</span><br><span class="line">    取值:  数组名[索引];</span><br><span class="line">静态初始化:   只指定内容,不指定长度,由java自动计算长度;</span><br><span class="line">	数据类型[]  数组名 = <span class="keyword">new</span> 数据类型[]&#123;元素<span class="number">1</span>,元素<span class="number">2</span>....&#125;;</span><br><span class="line">	简写: 数据类型[]  数组名 = &#123;元素<span class="number">1</span>,元素<span class="number">2</span>....&#125;;</span><br></pre></td></tr></table></figure>
<h3 id="注意事项-1"><a href="#注意事项-1" class="headerlink" title="注意事项"></a>注意事项</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1</span>:数组的长度是固定不变的;</span><br><span class="line"><span class="number">2</span>:数组的索引是从<span class="number">0</span>开始,到最大长度减一的正整数;</span><br><span class="line"><span class="number">3</span>:数据的长度可以使用length获取;</span><br></pre></td></tr></table></figure>
<h2 id="常见操作"><a href="#常见操作" class="headerlink" title="常见操作"></a>常见操作</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1</span>:数组的遍历(迭代);</span><br><span class="line"><span class="number">2</span>:数组最值;</span><br><span class="line"><span class="number">3</span>:数组求和;</span><br><span class="line"><span class="number">4</span>:数组常见异常;(索引越界);</span><br></pre></td></tr></table></figure>
<h1 id="day05-方法"><a href="#day05-方法" class="headerlink" title="day05-方法"></a>day05-方法</h1><h2 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">把一堆代码放在了一起,形成了一个新的整体;</span><br></pre></td></tr></table></figure>
<h2 id="好处"><a href="#好处" class="headerlink" title="好处"></a>好处</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">提升了代码的复用性;</span><br></pre></td></tr></table></figure>
<h2 id="格式"><a href="#格式" class="headerlink" title="格式"></a>格式</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">static</span>  返回值类型  方法名(参数列表)&#123;</span><br><span class="line">    方法体;</span><br><span class="line">    <span class="keyword">return</span> 数据值;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">public</span> <span class="keyword">static</span>   固定的修饰符;</span><br><span class="line">返回值类型    可以是任意数据类型,如果方法没有返回值,则需要使用<span class="keyword">void</span>占位;</span><br><span class="line">方法名       小驼峰</span><br><span class="line">参数列表      形式参数,由数据类型和参数名组成;</span><br><span class="line">方法体       一堆代码;</span><br></pre></td></tr></table></figure>
<h2 id="注意事项-2"><a href="#注意事项-2" class="headerlink" title="注意事项"></a>注意事项</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1</span>:方法的定义不分先后顺序;</span><br><span class="line"><span class="number">2</span>:方法定义不能嵌套;</span><br><span class="line"><span class="number">3</span>:方法定义后,不调用不会执行;</span><br></pre></td></tr></table></figure>
<h2 id="定义方法的原则"><a href="#定义方法的原则" class="headerlink" title="定义方法的原则"></a>定义方法的原则</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">两个明确:</span><br><span class="line"><span class="number">1</span>:明确参数</span><br><span class="line"><span class="number">2</span>:明确返回值类型</span><br><span class="line"></span><br><span class="line">根据方法体;(根据需求),你在方法体中准备做什么事情,做事情的时候,需要的数据就可以通过参数让别人传递,做事情的结果可以通过返回值,告知调用方法的人,此方法运行的结果;</span><br></pre></td></tr></table></figure>
<h2 id="方法重载"><a href="#方法重载" class="headerlink" title="方法重载"></a>方法重载</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">在同一个类中,方法名相同,参数列表不同;</span><br><span class="line">参数列表不同:</span><br><span class="line"><span class="number">1</span>:类型不同;</span><br><span class="line"><span class="number">2</span>:个数不同;</span><br><span class="line"><span class="number">3</span>:顺序不同;</span><br></pre></td></tr></table></figure>

      
    </div>

    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Java/" rel="tag"> <i class="fa fa-tag"></i> Java</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2019/09/05/Day5_方法/" rel="next" title="Day5_方法">
                <i class="fa fa-chevron-left"></i> Day5_方法
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/09/09/Day7_类和对象/" rel="prev" title="Day7_类和对象">
                Day7_类和对象 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



<div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
<span class="jiathis_txt">分享到：</span>
<a class="jiathis_button_fav">收藏夹</a>
<a class="jiathis_button_copy">复制网址</a>
<a class="jiathis_button_email">邮件</a>
<a class="jiathis_button_weixin">微信</a>
<a class="jiathis_button_qzone">QQ空间</a>
<a class="jiathis_button_tqq">腾讯微博</a>
<a class="jiathis_button_douban">豆瓣</a>
<a class="jiathis_button_share">一键分享</a>

<a href="http://www.jiathis.com/share?uid=2140465" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">更多</a>
<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript">
var jiathis_config={
  data_track_clickback:true,
  summary:"",
  shortUrl:false,
  hideMore:false
}
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=" charset="utf-8"></script>
<!-- JiaThis Button END -->
      
</div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/icon.jpg" alt="大狗">
            
              <p class="site-author-name" itemprop="name">大狗</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">45</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">3</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/zhaowenhao99" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                Links
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://zhaowenhao99.github.io" title="大狗之家" target="_blank">大狗之家</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Day6"><span class="nav-number">1.</span> <span class="nav-text">Day6</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#day01-java入门"><span class="nav-number">2.</span> <span class="nav-text">day01-java入门</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#jdk组成"><span class="nav-number">2.1.</span> <span class="nav-text">jdk组成</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#标识符"><span class="nav-number">2.2.</span> <span class="nav-text">标识符</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#关键字"><span class="nav-number">2.3.</span> <span class="nav-text">关键字</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#常量"><span class="nav-number">2.4.</span> <span class="nav-text">常量</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#数据类型"><span class="nav-number">2.5.</span> <span class="nav-text">数据类型</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#基本数据类型"><span class="nav-number">2.5.1.</span> <span class="nav-text">基本数据类型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#引用数据类型"><span class="nav-number">2.5.2.</span> <span class="nav-text">引用数据类型</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#变量"><span class="nav-number">2.6.</span> <span class="nav-text">变量</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#定义格式"><span class="nav-number">2.6.1.</span> <span class="nav-text">定义格式</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#类型转换"><span class="nav-number">2.7.</span> <span class="nav-text">类型转换</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#day02-运算符-键盘输入-if语句"><span class="nav-number">3.</span> <span class="nav-text">day02-运算符,键盘输入,if语句</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#运算符"><span class="nav-number">3.1.</span> <span class="nav-text">运算符</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#算术运算符"><span class="nav-number">3.1.1.</span> <span class="nav-text">算术运算符</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#关系运算符"><span class="nav-number">3.1.2.</span> <span class="nav-text">关系运算符</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#赋值运算符"><span class="nav-number">3.1.3.</span> <span class="nav-text">赋值运算符</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#逻辑运算符"><span class="nav-number">3.1.4.</span> <span class="nav-text">逻辑运算符</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#三元运算符"><span class="nav-number">3.1.5.</span> <span class="nav-text">三元运算符</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#键盘输入"><span class="nav-number">3.2.</span> <span class="nav-text">键盘输入</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#if语句"><span class="nav-number">3.3.</span> <span class="nav-text">if语句</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#day03-switch语句-循环语句-随机数"><span class="nav-number">4.</span> <span class="nav-text">day03-switch语句,循环语句,随机数</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#switch语句"><span class="nav-number">4.1.</span> <span class="nav-text">switch语句</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#注意事项"><span class="nav-number">4.1.1.</span> <span class="nav-text">注意事项</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#循环语句"><span class="nav-number">4.2.</span> <span class="nav-text">循环语句</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#for循环"><span class="nav-number">4.2.1.</span> <span class="nav-text">for循环</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#while循环"><span class="nav-number">4.2.2.</span> <span class="nav-text">while循环</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#for和while的区别"><span class="nav-number">4.2.3.</span> <span class="nav-text">for和while的区别</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#跳转语句"><span class="nav-number">4.2.4.</span> <span class="nav-text">跳转语句</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#循环嵌套"><span class="nav-number">4.2.5.</span> <span class="nav-text">循环嵌套</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#随机数"><span class="nav-number">4.3.</span> <span class="nav-text">随机数</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#day04-idea与数组"><span class="nav-number">5.</span> <span class="nav-text">day04-idea与数组</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#idea快捷键"><span class="nav-number">5.1.</span> <span class="nav-text">idea快捷键</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#数组"><span class="nav-number">5.2.</span> <span class="nav-text">数组</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#注意事项-1"><span class="nav-number">5.2.1.</span> <span class="nav-text">注意事项</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#常见操作"><span class="nav-number">5.3.</span> <span class="nav-text">常见操作</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#day05-方法"><span class="nav-number">6.</span> <span class="nav-text">day05-方法</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#概述"><span class="nav-number">6.1.</span> <span class="nav-text">概述</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#好处"><span class="nav-number">6.2.</span> <span class="nav-text">好处</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#格式"><span class="nav-number">6.3.</span> <span class="nav-text">格式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#注意事项-2"><span class="nav-number">6.4.</span> <span class="nav-text">注意事项</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#定义方法的原则"><span class="nav-number">6.5.</span> <span class="nav-text">定义方法的原则</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#方法重载"><span class="nav-number">6.6.</span> <span class="nav-text">方法重载</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">大狗</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">Site words total count&#58;</span>
    
    <span title="Site words total count">39.5k</span>
  
</div>


  <div class="powered-by">个人专属</div>



  <span class="post-meta-divider">|</span>



<div class="powered-by">
<span id="sitetime"></span>
<script language="javascript">
  function siteTime(){
    window.setTimeout("siteTime()", 1000);
    var seconds = 1000;
    var minutes = seconds * 60;
    var hours = minutes * 60;
    var days = hours * 24;
    var years = days * 365;
    var today = new Date();
    var todayYear = today.getFullYear();
    var todayMonth = today.getMonth()+1;
    var todayDate = today.getDate();
    var todayHour = today.getHours();
    var todayMinute = today.getMinutes();
    var todaySecond = today.getSeconds();
    /* Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
    year - 作为date对象的年份，为4位年份值
    month - 0-11之间的整数，做为date对象的月份
    day - 1-31之间的整数，做为date对象的天数
    hours - 0(午夜24点)-23之间的整数，做为date对象的小时数
    minutes - 0-59之间的整数，做为date对象的分钟数
    seconds - 0-59之间的整数，做为date对象的秒数
    microseconds - 0-999之间的整数，做为date对象的毫秒数 */
    var t1 = Date.UTC(2019,04,5,15,00,00); //北京时间2018-2-13 00:00:00
    var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
    var diff = t2-t1;
    var diffYears = Math.floor(diff/years);
    var diffDays = Math.floor((diff/days)-diffYears*365);
    var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
    var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
    var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
    document.getElementById("sitetime").innerHTML=" 已运行"+/*diffYears+" 年 "+*/diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
  }/*因为建站时间还没有一年，就将之注释掉了。需要的可以取消*/
  siteTime();
</script>
</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/koharu.model.json"},"display":{"position":"right","width":150,"height":300},"mobile":{"show":true},"log":false});</script></body>
<script type="text/javascript" src="/js/src/clicklove.js"></script>
</html>
